// 商品相关
import request from '@/utils/request'

// 获取商品分类
export const getGoodsCate = params => {
    return request({
        method: 'get',
        url: '/goods/catelist',
        params
    })
}

// 修改分类
export const updateGoodsCate = data => {
    return request({
        method: 'post',
        url: '/goods/editcate',
        data
    })
}

// 获取分类名称
export const getGoodsCateName = () => {
    return request({
        method: 'get',
        url: '/goods/categories'
    })
}

// 获取商品列表
export const getGoodsList = params => {
    return request({
        method: 'get',
        url: '/goods/list',
        params
    })
}

// 添加商品
export const addGoods = data => {
    return request({
        method: 'post',
        url: '/goods/add',
        data
    })
}